package com.example.demo.day.config.learn.designBook.secondDay.part1;

import com.example.demo.day.config.learn.designBook.secondDay.part1.IBook;

//小说类
public class NovelBook implements IBook {

    //书籍名称
    private String name;

    //书籍价格
    private int price;

    //书籍作者
    private String author;

    //通过构造函数传递书籍数据
    public NovelBook(String _name, int _price, String _author) {
        this.name = _name;
        this.price = _price;
        this.author = _author;
    }

    //获得书籍的名称
    public String getName() {
        return this.name;
    }

    //获得书籍的价格
    public int getPrice() {
        return this.price;
    }

    //获得书籍的作者
    public String getAuthor() {
        return this.author;
    }
}
